﻿@*
    * ---------------------------------------------------
    * 作者: MTQ
    * 日期： 2021/4/16 16:59:48
    * ---------------------------------------------------
*@
@model MTQ.Model.M_EmailNotice
@using MTQ.BLL

@{
    Layout = "~/Views/Shared/_Layout_lay_admin.cshtml";
}

<style>
    body {
        background-color: #ffffff;
    }
</style>

<div class="layui-form layuimini-form">
    <div class="layui-form-item layui-hide">
        <label class="layui-form-label  " formeld_key="EN_ID" txt='EN_ID'></label>
        <div class="layui-input-block">
            <input type="text" name="EN_ID" placeholder="" value="@Model.EN_ID" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label " formeld_key="ProjectNumber" txt='ProjectNumber'></label>
        <div class="layui-input-block">
            <input type="text" name="ProjectNumber" placeholder="" value="@Model.ProjectNumber" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label " formeld_key="ES_Receiver" txt='ES_Receiver'></label>
        <div class="layui-input-block">
            <input type="text" name="ES_Receiver" placeholder="" value="@Model.ES_Receiver" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label " formeld_key="ES_CC" txt='ES_CC'></label>
        <div class="layui-input-block">
            <input type="text" name="ES_CC" placeholder="" value="@Model.ES_CC" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label " formeld_key="ES_Title" txt='ES_Title'></label>
        <div class="layui-input-block">
            <input type="text" name="ES_Title" placeholder="" value="@Model.ES_Title" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label " formeld_key="ES_Content" txt='ES_Content'></label>
        @*<div class="layui-input-block">
                <input type="text" name="ES_Content" placeholder="" value="@Model.ES_Content" autocomplete="off" class="layui-input">
            </div>*@

        <div class="layui-input-block">
            <textarea name="User_Remark" id="User_Remark" class="layui-textarea" placeholder="" style="height:300px; display: none;"> @Html.Raw(@Model.ES_Content)  </textarea>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">发送</button>
        </div>
    </div>
</div>



<script>
    layui.use(['form', 'layedit'], function () {
        var form = layui.form,
            layer = layui.layer,

            $ = layui.$;
        var layedit = layui.layedit;

        layedit.build('User_Remark'); //建立编辑器

        //监听提交
        form.on('submit(saveBtn)', function (data) {

            $.ajax({
                url: '/M_EmailNotice/EditEmail',
                type: 'post',
                dataType: 'text',
                data: data.field,
                success: function (resp) {
                    var json = eval('(' + resp + ')');

                    var ok = function () {
                        // 关闭弹出层
                        layer.close(index);
                        parent.reloadTable();
                        var iframeIndex = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(iframeIndex);
                    };
                    var nok = function () { }
                    if (json.Code == "m001") {
                        var index = layer.alert(json.Message, ok);
                    } else {
                        var index = layer.alert(json.Message, nok);
                    }

                    //layer.alert(json.Message);
                    //reloadTable();
                },
                error: function (resp) {
                    layer.alert("对不起出错了");
                }
            });


            return false;
        });
        showFormelDtxt(m_emailnotice_entity);
    });
</script>








